import { defineConfig } from '@rsbuild/core'
import { pluginBabel } from '@rsbuild/plugin-babel'
import { pluginVue } from '@rsbuild/plugin-vue'
import { pluginVueJsx } from '@rsbuild/plugin-vue-jsx'
import { pluginLess } from '@rsbuild/plugin-less'

export default defineConfig({
    output: {
        sourceMap: {
            //!解决热更新问题
            js: 'eval'
        }
    },
    source: {
        alias: {
            '@': './src'
        }
    },
    plugins: [
        pluginBabel({
            include: /\.(?:jsx|tsx)$/
        }),
        pluginVue(),
        pluginVueJsx(),
        pluginLess({
            lessLoaderOptions: {
                lessOptions: {
                    javascriptEnabled: true,
                    modifyVars: {
                        'arcoblue-1': '#F5E8FF',
                        'arcoblue-2': '#DDBEF6',
                        'arcoblue-3': '#C396ED',
                        'arcoblue-4': '#A871E3',
                        'arcoblue-5': '#8D4EDA',
                        'arcoblue-6': '#722ED1',
                        'arcoblue-7': '#551DB0'
                    }
                }
            }
        })
    ],
    tools: {
        lightningcssLoader: true
    }
})
